<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" href="css/bootstrap.css" />
	<link rel="stylesheet" href="wall.css" />
	<script type="text/javascript" src="js/jquery.js"></script>
	
	<title>资料库</title>
	<style type="text/css">
		body{
			background-image:url(img/scribble_light.png);
			
		}
		#form{
			margin-left:150px;
		}
		
	</style>
</head>
<body>
	<div class="navbar">
		<div class="navbar-inner">
			<div class="container">
				<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
				  <span class="icon-bar"></span>
				  <span class="icon-bar"></span>
				  <span class="icon-bar"></span>
				</a>
				<a class="brand" href="#" style="margin-left:50px">${projectname }</a>
				<div class="nav-collapse">
				  <ul class="nav">
					<li><a href="main.jspx">最新动态</a></li>
					<li><a href="goal.jspx">目标</a></li>
					<li class="active"><a href="document.jspx">资料库</a></li>
					<li><a href="filetype.jspx">文件共享</a></li>
					<li><a href="person.jspx">联系人</a></li>
					<li><a href="idea.jspx">想法</a></li>
					<li><a href="#">Bug</a></li>
					<li><a href="#">项目设置</a></li>					
				  </ul>					
				</div>
			</div>
		</div>
	</div>
	<div class="container" id="form">
	    <div class="row">
			<div class="first">
				<div class="span6">				
					<h2>资料库</h2>						
				</div>				
			</div>
		</div>
		<div class="row">
			<div class="span9">
				<ul class="breadcrumb">
					<li class="active">
						<a href="#"><i class="icon-folder-open"></i>资料库</a>
					</li>
					<li style="float:right"><i class="icon-plus"></i><a href="document.jspx?_m=new" class="link-black">分享新资料</a></li>
				</ul>
				<c:forEach items="${requestScope.document}" var="p" >
				<blockquote>
					<a href="document.jspx?_m=get&id=${p.id }"><h3>${p.title }</h3></a> 
					<p>${p.text }</p>					
					<small>${p.t_user_id }发布于${p.createtime }</small>
					<a href="document.jspx?_m=edit&id=${p.id }" title="编辑"><i class="icon-pencil"></i></a>
					<a title="删除" class="del_link" rel="${p.id }" href="javascript:;"><i class="icon-trash"></i></a>
				</blockquote>
				</c:forEach>
				<div class="btn-group" style="float:right;margin-top:20px">
					<button class="btn"><a href="">首页</a></button>
					<button class="btn"><a href="">1</a></button>
					<button class="btn"><a href="">2</a></button>
					<button class="btn"><a href="">3</a></button>
					<button class="btn"><a href="">4</a></button>
					<button class="btn"><a href="">末页</a></button>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
    	$(document).ready(function(){
    		$(".del_link").click(function(){
    			var id = $(this).attr("rel");
    			if(confirm("确定要删除此数据？")) {
					window.location.href = "document.jspx?_m=del&id=" + id;
    			}
    			
    		});
    		
    	});
    	</script>
</body>
</html>